package com.star.rpc.loadbalancer;

import com.star.rpc.spi.SpiLoader;

/**
 * packageName com.star.rpc.loadbalancer
 *
 * @author zerostart
 * @className LoadBalancerFactory
 * @date 2024/12/8
 * @description
 */
public class LoadBalancerFactory {

    static {
        SpiLoader.load(LoadBalancer.class);
    }


    public static final LoadBalancer DEFAULT_LoadBALANCER = new RoundRobinLoadBalancer();

    /**
     * 获取实例
     */

    public static LoadBalancer getLoadBalancer(String key) {
        return SpiLoader.getInstance(LoadBalancer.class, key);
    }
}
